# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=mtscan
pkgver=167.099482e
pkgrel=1
pkgdesc='Mikrotik RouterOS wireless scanner.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-wireless')
url='https://github.com/kkonradpl/mtscan'
license=('GPL2')
depends=('libpcap' 'openssl' 'gtk2' 'zlib' 'yajl' 'libssh')
makedepends=('git' 'cmake')
source=("git+https://github.com/kkonradpl/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  mkdir -p build

  cd build

  cmake -DCMAKE_INSTALL_PREFIX=/usr ..

  make
}

package() {
  cd $pkgname

  install -Dm 755 "build/src/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

